import com.example.AppConfig;
import com.example.MyBean;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        // 创建 Spring 上下文
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        // 获取 Bean
        MyBean myBean = context.getBean(MyBean.class);
        System.out.println(myBean);
        // 关闭 Spring 上下文
        context.close();
    }
}
